
function Square(){
    this.data = [
        [0,2,0,0],
        [0,2,0,0],
        [0,2,0,0],
        [0,2,0,0]
    ]
    // 原点(起始点)
    this.origin = {
        x:0,
        y:0
    }
}
var test = {};
Square.prototype.canDown = function(isValLegal){
    test.x = this.origin.x + 1;
    test.y = this.origin.y;
    return isValLegal(test,this.data);
}
Square.prototype.canLeft = function(isValLegal){
    test.x = this.origin.x;
    test.y = this.origin.y - 1;
    return isValLegal(test,this.data);
}
Square.prototype.canRight = function(isValLegal){
    test.x = this.origin.x;
    test.y = this.origin.y +1;
    return isValLegal(test,this.data);
}
Square.prototype.down = function(){
    this.origin.x = this.origin.x + 1;
}
Square.prototype.up = function(){
    
}
Square.prototype.left = function(){
    this.origin.y = this.origin.y - 1;
}
Square.prototype.right = function(){
    this.origin.y = this.origin.y + 1;
}
Square.prototype.space = function(){
    
}